package com.example.martian.mapper;

import com.example.martian.pojo.YzcmInformation;
import com.example.martian.pojo.YzcmMillOrder;
import jnr.ffi.annotations.In;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

@Repository
public interface MartianOrePoolMapper {

    //查询所有矿机
    List<Map<String,Object>> selectMillAll(@Param("goodsType") Integer goodsType,Integer typeMill);

    List<Map<String,Object>> selectMillAllByGoodsType(@Param("goodsType") Integer goodsType);

    //热销
    List<Map<String,Object>> selectMillAllByHost();

    //云算力查询
    List<Map<String,Object>> selectCloudHashrate(@Param("goodsType") Integer goodsType,Integer typeMill);

    //联合挖矿查询
    List<Map<String,Object>> selectUnitedMining(@Param("goodsType") Integer goodsType,Integer typeMill);

    //专区查询
    List<Map<String,Object>> selectPrifecture();

    //矿种查询
    List<Map<String,Object>> selectMinerals();

    //根据id查询商品详情
    List<Map<String,Object>> selectMillAllById(@Param("productId") Integer productId);

    //订单查询
    List<Map<String,Object>> selectOrderByAddress(@Param("address") String address,@Param("type") Integer type);

    //添加订单
    void insertOrder(YzcmMillOrder yzcmMillOrder);

    //添加交易信息
    void insertInformation(YzcmInformation yzcmInformation);

    //修改矿机台数
    void updateMillCount(BigDecimal millCount,Integer productId);

    //矿机配置参数
    List<Map<String,Object>> selectMillConfig(Integer productId);

    //根据矿机Id查询
    String selectGoodsType(Integer productId);

    Integer selectIdByAddress(String address);

    //查询直接奖励百分比
    String selectDirectReward(Integer userId);

    //查询间接奖励百分比
    String selectIndirectReward(Integer userId);

    //根据id查询直接邀请和间接邀请id
    List<Map<String,Object>> selectDirectAndIndirectById(Integer userId);

    //查询邀请奖励
    String selectInviteAward(Integer userId);

    //更新邀请奖励
    void updateAwardById(BigDecimal inviteAward,Integer userId);

    List<Map<String,Object>> selectUsdtMoneyById(Integer userId);

    //<!--更新邀请人USDT余额-->
    void updateUsdtBalance(String money,String address);

    //根据地址查询Usdt金额
    String selectUsdtMoneyByAddress(String address);
}
